package com.fesine.ch02.t10;

/**
 * @description: 类描述
 * @author: Fesine
 * @createTime:2016/7/12 16:51
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2016/7/12 16:51
 */
public class PrintString implements Runnable {
    private boolean isContinuePrint = true;
    public boolean isContinuePrint() {
        return isContinuePrint;
    }

    public void setContinuePrint(boolean isContinuePrint) {
        this.isContinuePrint = isContinuePrint;
    }

    public void pringStringMethod() {
        while (isContinuePrint == true) {
            System.out.println("run printStringMethod threadName=" + Thread.currentThread()
                    .getName());
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void run() {
        pringStringMethod();
    }
}
